package com.city.controller;

import com.city.domain.pub.PubSystem;
import com.city.service.pub.PubSystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @deprecation 智慧兴文公共信息平台-主界面
 * @email leichuqiao@126.com
 * @author 雷楚桥
 * @date 2018-07-07 11:14
 */
@Controller
public class IndexController {

    @Autowired
    private PubSystemService pubSystemService;

    /**
     * @deprecation 主页展示重定向
     * @author 雷楚桥
     * @date 2018-07-07 11:15
     */
    @RequestMapping(value = {"/index","/index.jsp","/index.htm","/index.do","/index.page"})
    public void index_response(HttpServletResponse response) throws IOException {
        response.sendRedirect("");
    }

    /**
     * @deprecation 主页展示
     * @author 雷楚桥
     * @date 2018-07-07 11:19
     */
    @RequestMapping("")
    public String index(Map<String,Object> map){
        List<PubSystem> pubSystemList = pubSystemService.findAllTopSystem();
        map.put("pubSystemList",pubSystemList);
        return "/index/index";
    }


    @RequestMapping("/wx.html")
    public String wx_html(){
        return "/index/code";
    }

}
